<template>
	<view style="padding: 20rpx;">
		<view>
			<view class="certificate">
				<view class="certificate_item">
					<view>
						<view>
							<text>基础证件</text>
							<text @click="enterUpload">去上传</text>
						</view>
						<view>已上传1个证件</view>
					</view>
					<view @click="isUnfold(1)">
						<image :class="{'down':isUnfolda}" src="../../static/img/zsjt.png" mode="widthFix" style="width: 100rpx;"></image>
					</view>
				</view>
				<view class="ccieItem" v-if="isUnfolda">
					<image src="../../static/img/ss.png" class="ccieItemImg" mode="widthFix"></image>
				</view>
			</view>
			<view class="certificate">
				<view class="certificate_item">
					<view>
						<view>
							<text>机构证书</text>
							<text>去考证</text>
						</view>
						<view>已上传1个证件</view>
					</view>
					<view @click="isUnfold(2)">
						<image  src="../../static/img/zsjt.png" mode="widthFix" style="width: 100rpx;"></image>
					</view>
				</view>
			</view>
			<view class="certificate">
				<view class="certificate_item">
					<view>
						<view>
							<text>技能证书</text>
							<text>去考证</text>
						</view>
						<view>已上传1个证件</view>
					</view>
					<view @click="isUnfold(3)">
						<image src="../../static/img/zsjt.png" mode="widthFix" style="width: 100rpx;"></image>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isUnfolda:false,
				isUnfoldb:false,
				isUnfoldc:false,
			};
		},
		methods: {
			enterUpload() {
				uni.navigateTo({
					url: '../upload/uploadCertificate'
				});
			},
			isUnfold(index){
				if(index === 1){
					this.isUnfolda = !this.isUnfolda;
					return;
				};
				if(index === 2){
					this.isUnfoldb = !this.isUnfoldb;
					return;
				};
				if(index === 3){
					this.isUnfoldc = !this.isUnfoldc;
					return;
				}
			}
		}
	};
</script>

<style lang="scss" scoped>
	.certificate {
		background: #05B2B5;
		padding: 30rpx 40rpx;
		-moz-border-radius: 1em;
		-webkit-border-radius: 1em;
		border-radius: 1em;
		width: 85%;
		margin: 0 auto;
		margin-bottom: 30rpx;
	}

	.certificate_item {
		color: #fff;
		display: flex;
		justify-content: space-between;
		align-items: center;

		>view {
			&:nth-child(1) {
				>view {
					&:nth-child(1) {
						>text {
							&:nth-child(1) {
								font-size: 32rpx;
							}

							&:nth-child(2) {
								font-size: 24rpx;
								background: #50C9CB;
								border-radius: 50rpx;
								padding: 8rpx 28rpx;
								margin-left: 30rpx;
								margin-bottom: 10rpx;
							}
						}
					}
					&:nth-child(2) {
						font-size: 24rpx;
						margin-top: 20rpx;
					}
				}
			}
		}
	}

	.ccieItem {
		display: flex;
		align-items: center;
		justify-content: center;
		border-top: 1rpx solid #FFFFFF;
		padding-top: 46rpx;
		margin-top: 46rpx;

		>image {
			width: 560rpx;
		}

	}
	.down{
		animation:turn 0.5s linear forwards;
	}
	  @keyframes turn{
	      0%{-webkit-transform:rotate(0deg);}
	      50%{-webkit-transform:rotate(90deg);}
	      100%{-webkit-transform:rotate(180deg);}
	    }
</style>
